export default {
    inserted: function(el, binding) {
        // const { callback, time }
        let [callback,time = 3000] = binding.value
        el.callback = callback
        el.time = time
        el.addEventListener('click', () => {
          const nowTime = new Date().getTime()
          if (!el.preTime || nowTime - el.preTime > el.time) {
            el.preTime = nowTime
            el.callback()
          }
        })
      },
      update: function(el, binding) {
        let [callback,time = 3000] = binding.value
        el.callback = callback
        el.time = time
      }
}